/*
日志等级类的设计
UNKNOW 0
DEBUG 进⾏debug时候打印⽇志的等级
INFO 打印⼀些⽤⼾提⽰信息
WARN 打印警告信息
ERROR 打印错误信息
FATAL 打印致命信息- 导致程序崩溃的信息
OFF 关闭所有⽇志输出
*/

#ifndef __M_LEVEL_H__
#define __M_LEVEL_H__

#include <iostream>

namespace clog
{
    class LogLevel
    {
    public:
        enum class value
        {
            UNKNOW = 0,
            DEBUG,
            INFO,
            WARM,
            ERROR,
            FATAL,
            OFF
        };

        static const char *toString(LogLevel::value level)
        {
            switch (level)
            {
            case LogLevel::value::DEBUG:
                return "DEBUG";
            case LogLevel::value::INFO:
                return "INFO";
            case LogLevel::value::WARM:
                return "WARM";
            case LogLevel::value::ERROR:
                return "ERROR";
            case LogLevel::value::FATAL:
                return "FATAL";
            case LogLevel::value::OFF:
                return "OFF";
            default:
                return "UNKNOW";
            }
            return "UNKNOW";
        }
    };

}

#endif